Working with Wireless in Linux

Written by Ken Gypen

April 25, 2008 | 08:01

Tags: #atheros #encryption #wep #wifi #wireless #wpa

Companies: #intel

Modules

So, now that we've made sure the hardware we are searching for exists, it's time to check for the drivers.

There's just one problem – a Linux system doesn't use drivers, it uses kernel modules. What they are, how they work and even how you write your own is documented in detail over at The Linux Documentation Project, a project devoted to documenting every aspect of the Linux kernel. You can read it if you like, or you can save years of your life and infinite boredom if you don't need to know everything there is.

The handy thing about the Linux implementation of modules is that they're hot-pluggable, unlike the Windows Driver system. Once you find a module you like, you can just load it and use it straight away. No more rebooting!

Now if you are lucky (or very clever) and have a chipset that is supported natively by the Linux kernel, chances are that the module is already loaded. Just Google your chipset name combined with 'module Linux' and you'll quickly find out the name of the module. Then you can verify if it's loaded by issuing sudo lsmod. You'll get a list of all the loaded kernel modules. If the required module isn't loaded, you can easily load it by issuing a sudo modprobe <module_name>. That's all you need to do to load a driver! You can even remove it by issuing rmmod <module_name>, if you need to change things around or switch versions.

However if you aren't lucky enough to have a chipset with a native Linux module, things are a bit more complicated. Most likely, if supported, you'll need to add a layer between the kernel module and the actual information. This is where the incredibly handy NDISwrapper project steps in.

If NDISwrapper isn't found, it's easy to get...but you have to enable a couple packages first.

If NDISwrapper isn't found, it's easy to get...but
you have to enable a couple packages first.

With NDISwrapper, you can use your Windows drivers to power your Linux wireless. The program achieves this by implementing a Windows kernel and Network Driver Interface Specification API within a Linux kernel. This enables the Windows driver to run as a kernel module without any form of emulation in between it.

The only downside to this is that some chipset manufacturers write their Windows drivers in such a manner (I even dare to call it badly) that even NDISwrapper can't load it. A pretty impressive list is available which tells us what drivers are known to work. If your chipset isn't listed, make sure to try it anyway. The list is far from complete and with every release of NDISwrapper more chipsets are supported.

Now, how do you get NDISwrapper up and running? Well, the first step is of course to install it. Just like with lshw, this can be done though Synaptic – just install the ndiswrapper-common and nidswrapper-utils packages. You'll probably need to enable the multiverse and universe repositories first! However this is just a matter clicking a couple of times.

The unplugged souls can once again fetch the two packages from another computer and install them like they did with lshw. While you are browsing the net, also head over to your wireless card manufacturer's website and get the XP and Windows 2000 drivers – we'll need them too.

Next, we dive into the terminal again to install the Windows XP driver into NDISwrapper. First, extract the archive that the drivers are usually packed in and place the .inf and .sys files on your system. The installation of this driver into NDISwrapper is dead easy – issue a sudo ndiswrapper -i /path/to/driver.inf does the trick. You can verify if the driver is loaded correctly by issuing ndiswrapper -l. That should list both hardware and driver as present. If it doesn't, try installing the Windows 2000 driver instead of the XP one.

If your Windows driver can't be installed in NDISwrapper, chances are slim to none that the card will work. At this very unfortunate (and unlikely) point, I'd suggest you start mailing your chipset manufacturer and ask for a native Linux module and think twice before buying something from that manufacturer again. Or is that just the grumpy Linux user in me talking?

With NDISwrapper prepared, we still need to load it as a kernel module. So, like we did with the native drivers, just issue sudo modprobe ndiswrapper to load it.
Discuss this in the forums
YouTube logo
MSI MPG Velox 100R Chassis Review

October 14 2021 | 15:04